/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package fhv.itb.mst2955.server.persistence;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 * A server-side Country Entity.
 */
@Entity
@Table(name = "Country")
@NamedQueries({@NamedQuery(name = "Country.findAll", query = "SELECT c FROM Country c"), @NamedQuery(name = "Country.findById", query = "SELECT c FROM Country c WHERE c.id = :id"), @NamedQuery(name = "Country.findByName", query = "SELECT c FROM Country c WHERE c.name = :name"), @NamedQuery(name = "Country.findByNickName", query = "SELECT c FROM Country c WHERE c.nickName = :nickName")})
public class Country implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "name")
    private String name;
    @Basic(optional = false)
    @Column(name = "nickName")
    private String nickName;


    public Country() {
    }


    public Country(Integer id) {
        this.id = id;
    }


    public Country(Integer id, String name, String nickName) {
        this.id = id;
        this.name = name;
        this.nickName = nickName;
    }


    public Integer getId() {
        return id;
    }


    public void setId(Integer id) {
        this.id = id;
    }


    public String getName() {
        return name;
    }


    public void setName(String name) {
        this.name = name;
    }


    public String getNickName() {
        return nickName;
    }


    public void setNickName(String nickName) {
        this.nickName = nickName;
    }


    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }


    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Country)) {
            return false;
        }
        Country other = (Country) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }


    @Override
    public String toString() {
        return "fhv.itb.mst2955.server.Country[id=" + id + "]";
    }

}
